package com.db.mapper;

import com.db.pojo.Associator;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 会员个人操作Mapper
 * @createtime 2020-04-03
 * @creator JingChu
 */
@Mapper
public interface AssociatorMapper {
    @Insert("INSERT INTO associator (id,openid) VALUE (#{id},#{openid})")
    int register(@Param("id") String id, @Param("openid") String openid);

    @Update("UPDATE associator SET ${setSql} WHERE id=#{id}")
    int update( @Param("setSql") String setSql, @Param("id") String id);

    @Select("SELECT * FROM associator WHERE openid=#{openid}")
    Associator getAssociatorByOpenid(@Param("openid") String openid);

    @Select("SELECT * FROM associator WHERE ${qeurySql}")
    List<Associator> getAssociatorList(@Param("qeurySql") String qeurySql);

}
